package top.codehelen.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.codehelen.pojo.Users;
import top.codehelen.service.UsersService;

/**
 * @Classname HelloController
 * @Description 测试
 * @Date 2021/5/11 5:06 下午
 * @Created by helen
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private UsersService usersService;


    @GetMapping("/test")
    public String hello(){
        return "<h1>hello</h1>";
    }


    @GetMapping("getUserInfo")
    public Users getUserInfo(@RequestParam String id){
        return usersService.getById(id);
    }
}
